﻿using AutoMapper;
using BW.WMS.BasicData_LC.Dto.Input;
using BW.WMS.BasicData_LC.Dto.OutPut;
using BW.WMS.LC.Dto.Input;
using BW.WMS.LC.Dto.OutPut;
using BW.WMS.Model;
using BW.WMS.RBAC;
using BW.WMS.StockControl_GJH.Dto.Input;
using BW.WMS.StockControl_GJH.Dto.Output;
using BW.WMS.StoreManagement_XKY.DTO.Input;
using BW.WMS.StoreManagement_XKY.DTO.Output;
using BW.WMS.XKY;
using BW.WMS.XKY.DTO.Input;
using BW.WMS.XKY.DTO.Output;
using BW.WMS.OperationKanban.WCL.Dto.Output;


namespace BW.WMS;

public class WMSApplicationAutoMapperProfile : Profile
{
    public WMSApplicationAutoMapperProfile()
    {
        /* You can configure your AutoMapper mapping configuration here.
         * Alternatively, you can split your mapping configurations
         * into multiple profile classes for a better organization. */
        CreateMap<UserModel, UserOutput>().ReverseMap();
        CreateMap<UserModel, UserInput>().ReverseMap();
        CreateMap<RoleModel, RoleInput>().ReverseMap();
        CreateMap<RoleModel, RoleOutput>().ReverseMap();
        CreateMap<latestAllotInput, latestAllotModel>().ReverseMap();
        CreateMap<latestSub, latestAllotSUBModel>().ReverseMap();
        CreateMap<UpdateAllotInput, latestAllotModel>().ReverseMap();
        CreateMap<updateSub, latestAllotSUBModel>().ReverseMap();
        // 添加Dm_Item到ItemOutput的映射 - 明确指定使用StoreManagement_XKY的ItemOutput
        CreateMap<Dm_Item, BW.WMS.StoreManagement_XKY.DTO.Output.ItemOutput>().ReverseMap();

        // 添加Dm_Item到ItemOutput的映射
        CreateMap<Dm_Item, StockControl_GJH.Dto.Output.ItemOutput>().ReverseMap();

        CreateMap<LatestStandingBookInput, StandingBookModel>().ReverseMap();
        CreateMap<UpdateStadingInput, StandingBookModel>().ReverseMap();
        CreateMap<UpStandingBookSubInput, StandingBookSubModel>().ReverseMap();
        CreateMap<StockControl_GJH.Dto.Input.StandingBookSubInput, StandingBookSubModel>().ReverseMap();

        CreateMap<ApproveInput, latestAllotInput>().ReverseMap();

        // 货品，仓库
        CreateMap<Dm_Item, StockControl_GJH.Dto.Output.ItemOutput>().ReverseMap();
        CreateMap<Dm_Warehouser, GetWareHouseOutput>().ReverseMap();
        //仓库
        CreateMap<CreateUpdateWareHouserDtoInput, Dm_Warehouser>().ReverseMap();
        CreateMap<Dm_Warehouser, WareHouseDto>().ReverseMap();
        //入库
        CreateMap<CreateUpdateCodeDtoInput, Dm_Code>().ReverseMap();
        CreateMap<Dm_Code, CodeDto>().ReverseMap();
        //部门
        CreateMap<AddDepInput,Dm_Dep>().ReverseMap();
        CreateMap<DepartmentDto, Dm_Dep>().ReverseMap();
        CreateMap<Dm_Encoderule, Dm_EncoderuleInput>();
        CreateMap<Dm_Encoderule, Dm_EncoderuleOutput>();
        CreateMap<Dm_EncoderuleInput, Dm_Encoderule>().ForMember(x => x.ConcurrencyStamp, x => x.Ignore());
        //库位管理
        CreateMap<AddUpdateLibrarylocationInput, Dm_Librarylocation>().ReverseMap();
        CreateMap<LibrarylocationDto, Dm_Librarylocation>().ReverseMap();
        CreateMap<Dm_Item, StoreManagement_XKY.DTO.Output.ItemOutput>().ReverseMap();
        CreateMap<Dm_Item, ItemInput>().ReverseMap();


        //管理
        CreateMap<AddMe_PurchaseHdInput, Me_PurchaseHd>().ReverseMap();
        CreateMap<Me_PurchaseHdDto, Me_PurchaseHd>().ReverseMap();

        //订单管理
        CreateMap<OrderFormModel, OrderFormDto>().ReverseMap();
        CreateMap<OrderFormInput, OrderFormModel>().ReverseMap();

        CreateMap<Dm_Item, Dm_ItemDto>().ReverseMap();
        CreateMap<Dm_Ent, Dm_EntDto>().ReverseMap();
        CreateMap<Dm_Ent, AddDm_EntInput>().ReverseMap();
        //订单管理
        CreateMap<OrderFormInput, OrderFormModel>().ReverseMap();
        CreateMap<OrderFormDto, OrderFormModel>().ReverseMap();
        //入库管理
        CreateMap<AddMe_StHdInput, Me_SaleHd>().ReverseMap();
        CreateMap<Me_StHd, Me_StHdDto>().ReverseMap();
        //客户
        CreateMap<Dm_Client, ClientOutput>().ReverseMap();
        //货品类型
        CreateMap<Dm_ItemType, ItemTyepOutput>().ReverseMap();

        //货品管理
        CreateMap<Dm_Item, GoodsOutput>();

        CreateMap<AddMe_StHdInput, Me_StHd>();
        CreateMap<AddMe_StHdInput, Me_StCur>();
        CreateMap<AddMe_StHdInput, Me_StSub>();
    }
}